<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<!-- 开发环境版本，包含了有帮助的命令行警告 -->
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
		<title>简单的评分</title>
		<style>
			.row{
				margin-top: 30px;
				border: 1px solid #eee;
				padding-top: 12px;
				padding-bottom: 12px;
				position: relative;
			}
			.col{
				display: inline-block;
				bottom: 0;
				width: 8%;
			}
	
		</style>
		<div id="app" class="row">
			<div class="col">
			<div>{{score}}分</div>
			<div :style="styleObj"></div>
			<button @click="add()">{{name}}</button>
			</div>
		
			<div class="col">
			<div>{{score}}分</div>
			<div :style="styleObj"></div>
			<button @click="add()">{{name}}</button>
			</div>
			
			<div class="col">
			<div>{{score}}分</div>
			<div :style="styleObj"></div>
			<button @click="add()">{{name}}</button>
			</div>
	</head>
	<body>
		<script>
			new Vue({
				el:"#app",
				data:{
					name:"张三+5",
					score:0
				},
				computed:{
					styleObj:function(){
						return{
							// width: '60px',
							width:'30px',
							height:5+this.score+'px',
							background:'HotPink',
						}
					}
				},
				methods:{
					add:function(){
						this.score+=5
					}
				}
			})
		</script>
	</body>
</html>
